﻿package com.toncen.samepms.basic.dao;

import java.util.List;

import com.toncen.samepms.basic.domain.Notification;
import com.toncen.samepms.common.AbstractDao;

/**
 * 描述：内部通知表BASIC_NOTIFICATION的dao文件
 * 
 * @author tch 
 */
public class NotificationDao  extends AbstractDao<Notification> {

	public NotificationDao() {
	}

	
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.comit.common.db.BaseDao#initialize()
	 */
	@Override
	protected void initialize() {
		setStatementPrefix("Notification");
		setStatementDivision(".");
	}


	/**
	 * 根据状态获取分页的内部通知
	 * 
	 * @param state
	 * @param pageSize
	 * @param page
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<Notification> getAllByState(long state, int pageSize, int page) throws Exception {
		return getSqlMap().queryForList(getStatement("getAllByState"), state, pageSize * (page - 1), pageSize);
	}
}
